/*
 * @Author: NJ_1098 xiabaoxin
 * @Date: 2025-02-13 11:02:30
 * @LastEditors: NJ_1098 xiabaoxin
 * @LastEditTime: 2025-02-13 16:14:15
 * @Description: 日志打印
 */
const logger = require("./log.js");

module.exports = async (ctx, next) => {
  const start = new Date();
  await next();
  const ms = new Date() - start;
  // console.log(`${ctx.method} ${ctx.url} - ${ms}ms`)
  // 使用log4j输出日志
  logger.info(`log4j输出日志：${ctx.method} ${ctx.url} - ${ms}ms`);
};
